package cn.swh.guguanjia.controller;

import cn.swh.guguanjia.entity.Result;
import cn.swh.guguanjia.service.ExamineService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.ModelAndView;

import java.util.Map;

@RestController
@RequestMapping("/mapper/examine")
public class ExamineController {

    /**
     * @Description
     * @Params
     * @return
     **/


    @Autowired
    ExamineService service;


    @RequestMapping({"/index", "/index.html"})
    public ModelAndView index() {
        return new ModelAndView("/examine/index.html");
    }

    @RequestMapping("selectPage/{pageNum}/{pageSize}")
    public Result selectPage(@PathVariable("pageNum") int pageNum, @PathVariable("pageSize") int pageSize, @RequestParam Map<String,Object> condition) {
        return new Result(service.selectPage(pageNum, pageSize, condition));
    }
}
